<div class="ibox">
<div class="ibox-content">
<form class="form-horizontal"  id="editForm" action="${cxt!}/platform/operator/update" method="POST" >

		   <input type="hidden" id="operatorid" name="operator.id" value="${operator.id!}" >
			
           <div class="form-group">
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.operatorName"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="operator.name" placeholder="${_res['systemManage.operatorName']}" value="${operator.name!}"  required aria-required="true">
	             </div>
	             
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.operatorNameen"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="operator.nameen" placeholder="${_res['systemManage.operatorNameen']}" value="${operator.nameen!}"  required aria-required="true">
	             </div>	             
           </div>
           <div class="hr-line-dashed"></div>
           
           <div class="form-group">
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.operatorUrl"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="operator.url" placeholder="${_res['systemManage.operatorUrl']}URL" value="${operator.url!}"  required aria-required="true" >
	             </div>	       
	             
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.operatorCode"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="operator.code" placeholder="${_res['systemManage.operatorCode']}" value="${operator.code!}"  required aria-required="true" readonly="readonly">
	             </div>	 	                   
           </div>
           <div class="hr-line-dashed"></div>           
 
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["systemManage.operatorByMenuSystem"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
	              	<input type="text" class="form-control" id="partentMenuName" name="partentMenuName" value="${operator.menu.name!}" placeholder="${_res['systemManage.menuSelect']}" data-toggle="modal" data-target="#myModal">
	              	<span><input type="checkbox" id="thisNoParent"> 若无所属菜单，请勾选。</span>

	                <!-- 父菜单id，从modal中获取 -->
	             	<input type="hidden" name="operator.menuid"  id="parentMenuId" value="${operator.menuid!}" required aria-required="true"/>	              	
                </div>		             
	             
                <label class="col-sm-2 control-label">${_res["systemManage.menuSystem"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict class="form-control" type="select" value="${operator.systemid!}" name="operator.systemid"  dictCode="SYSTEM_CODE" defaultValue="2" required="true"/>
                </div>	             	             
           </div>
           
           <div class="hr-line-dashed"></div>  
           
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["systemManage.isCheckPrivilege"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict class="form-control" type="select" value="${operator.privilegess!}" name="operator.privilegess"  dictCode="COMMON_YN" required="true"/>
                </div>	

                <label class="col-sm-2 control-label">${_res["systemManage.isLoginable"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict class="form-control" type="select" value="${operator.loginable!}" name="operator.loginable"  dictCode="COMMON_YN" required="true"/>
                </div>	                
           </div>
                      
           <div class="hr-line-dashed"></div>     
           
           <div class="form-group">
                <label class="col-sm-2 control-label">${_res["systemManage.isLogable"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict class="form-control" type="select" value="${operator.logable!}" name="operator.logable"  dictCode="COMMON_YN" required="true"/>
                </div>	

                <label class="col-sm-2 control-label">${_res["systemManage.menuStatus"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-sm-3">
                    <#dict type="select" class="form-control" name="operator.status"  dictCode="COMMON_STATUS"  value="${operator.status!}" required="true"/>
                </div>	
           </div>
           <div class="hr-line-dashed"></div>  
           
           <div class="form-group">
	             <label for="namebasic" class="col-md-2 control-label">${_res["systemManage.description"]}</label>
	             <div class="col-md-3">
	              	<input type="text" class="form-control" name="operator.description" placeholder="${_res['systemManage.description']}" value="${operator.description!}" >
	             </div>	 
                
           </div>
           <div class="hr-line-dashed"></div> 
                                  
            
            <div class="form-group">
              <div class="col-md-10 col-md-offset-2">
                <button type="button" class="btn btn-warning" onClick="ajaxContent('/platform/operator/list');">${_res["system.return"]}</button>
                <button type="submit" class="btn btn-primary" >${_res["system.confirm"]}</button>
                <button type="button" class="btn btn-danger" onClick="ajaxContent('/platform/operator/list');">${_res["system.cancel"]}</button>
              </div>
            </div>
</form>
</div></div>
<#submit  formId="editForm"  divId="content" />


<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModaLabel">
	<%include("selectPartentNode.html"){}%>
</div>
<#nav />

<script>
$(function(){
	 var parentMenuId = $("#parentMenuId").val();
	 if(parentMenuId==''|| parentMenuId==null){
		 $("#thisNoParent").attr("checked",'true');
         $("#partentMenuName").attr("disabled","disabled");
         $("#parentMenuId").removeAttr("aria-required");
         $("#parentMenuId").removeAttr("required");
	 }
	 
	 $("#thisNoParent").click(function(){
	     if($(this).attr("checked")){
	           	$(this).removeAttr("checked");
	           	$("#partentMenuName").removeAttr("disabled")
				$("#parentMenuId").attr("required","true");
				$("#parentMenuId").attr("aria-required","true");
	    }else{
	            $(this).attr("checked",'true');
	            $("#partentMenuName").attr("disabled","disabled");
	            $("#parentMenuId").removeAttr("aria-required");
	            $("#parentMenuId").removeAttr("required");
	            $(this).closest('div').removeClass('has-error').addClass('has-success');
	            $("#parentMenuId").val("");
	            $("#partentMenuName").val("");
	    }
	 })
	             	  
})
</script>